﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using SpaceNeedle.x6473.WindowsPhone.ViewModels;
using SpaceNeedle.x6473.WindowsPhone.Common;
using Windows.Networking.Connectivity;
using Microsoft.Phone.Tasks;
using Windows.ApplicationModel.DataTransfer;
using Windows.Foundation;
using SpaceNeedle.SDK.WindowsPhone.Views;
using System.Reflection;
using SpaceNeedle.x6473.WindowsPhone.Models;

namespace SpaceNeedle.x6473.WindowsPhone.Views
{
    public class CityDetailsView : ViewBase<CityDetailsViewModel> { }

    public partial class CityDetails : CityDetailsView
    {
        public CityDetails()
        {
            InitializeComponent();

            this.Loaded += CityDetails_Loaded;
            this.ViewModel.Loaded += ViewModel_Loaded;
        }

        void ViewModel_Loaded()
        {
            
        }

        void CityDetails_Loaded(object sender, RoutedEventArgs e)
        {

        }
        
        private void share_Click(object sender, EventArgs e)
        {
            string uri = AppViewModel.Instance.Properties.AppContent.CityDetails.CityDetailsShareButtonUri;
                        
            ShareLinkTask shareLinkTask = new ShareLinkTask();
            shareLinkTask.LinkUri = new Uri(uri, UriKind.Absolute);
            shareLinkTask.Show();
        }
    
        private void OnUploadsMenuItem_Click(object sender, EventArgs e)
        {
            this.ViewModel.UploadsCommand.Execute(null);      
        }

        private void OnSignOutMenuItem_Click(object sender, EventArgs e)
        {
            this.ViewModel.SignOutCommand.Execute(null);
        }

        private void OnAboutMenuItem_Click(object sender, EventArgs e)
        {
            this.ViewModel.AboutCommand.Execute(null);
        }
    }
}